{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# Neural Network ANN"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "import pandas as pd\n",
        "\n",
        "import warnings\n",
        "warnings.filterwarnings(\"ignore\")\n",
        "\n",
        "# fix_yahoo_finance is used to fetch data \n",
        "import fix_yahoo_finance as yf\n",
        "yf.pdr_override()"
      ],
      "outputs": [],
      "execution_count": 2,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# input\n",
        "symbol = 'AMD'\n",
        "start = '2014-01-01'\n",
        "end = '2019-01-01'\n",
        "\n",
        "# Read data \n",
        "dataset = yf.download(symbol,start,end)\n",
        "\n",
        "# View Columns\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[*********************100%***********************]  1 of 1 downloaded\n"
          ]
        },
        {
          "output_type": "execute_result",
          "execution_count": 3,
          "data": {
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume\n",
              "Date                                                    \n",
              "2014-01-02  3.85  3.98  3.84   3.95       3.95  20548400\n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200\n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300\n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100\n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700"
            ],
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-02</th>\n",
              "      <td>3.85</td>\n",
              "      <td>3.98</td>\n",
              "      <td>3.84</td>\n",
              "      <td>3.95</td>\n",
              "      <td>3.95</td>\n",
              "      <td>20548400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 3,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset['Open_Close'] = (dataset['Open'] - dataset['Adj Close'])/dataset['Open']\n",
        "dataset['High_Low'] = (dataset['High'] - dataset['Low'])/dataset['Low']\n",
        "dataset['Increase_Decrease'] = np.where(dataset['Volume'].shift(-1) > dataset['Volume'],1,0)\n",
        "dataset['Buy_Sell_on_Open'] = np.where(dataset['Open'].shift(-1) > dataset['Open'],1,0)\n",
        "dataset['Buy_Sell'] = np.where(dataset['Adj Close'].shift(-1) > dataset['Adj Close'],1,0)\n",
        "dataset['Returns'] = dataset['Adj Close'].pct_change()\n",
        "dataset = dataset.dropna()\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 4,
          "data": {
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "Date                                                                   \n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100    0.002387   \n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700    0.011820   \n",
              "2014-01-09  4.20  4.23  4.05   4.09       4.09  30667600    0.026190   \n",
              "\n",
              "            High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "Date                                                                           \n",
              "2014-01-03  0.030928                  1                 1         1  0.012658  \n",
              "2014-01-06  0.047619                  1                 1         1  0.032500  \n",
              "2014-01-07  0.034063                  0                 1         0  0.012107  \n",
              "2014-01-08  0.028986                  0                 0         0  0.000000  \n",
              "2014-01-09  0.044444                  0                 0         1 -0.021531  "
            ],
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0.002387</td>\n",
              "      <td>0.034063</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "      <td>0.011820</td>\n",
              "      <td>0.028986</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-09</th>\n",
              "      <td>4.20</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.05</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>30667600</td>\n",
              "      <td>0.026190</td>\n",
              "      <td>0.044444</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>-0.021531</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 4,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import neurolab as nl"
      ],
      "outputs": [],
      "execution_count": 1,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "X = np.array(dataset['Increase_Decrease'])\n",
        "Y = np.array(dataset['Buy_Sell'])"
      ],
      "outputs": [],
      "execution_count": 48,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "size = len(X)\n",
        "inp = X.reshape(size,1)\n",
        "tar = Y.reshape(size,1)"
      ],
      "outputs": [],
      "execution_count": 50,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "inp_min = np.min(inp)\n",
        "inp_max = np.max(inp)\n",
        "print (inp_min,inp_max)"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "0 1\n"
          ]
        }
      ],
      "execution_count": 51,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "net = nl.net.newff([[inp_min, inp_max]],[5, 1],[nl.trans.PureLin(), nl.trans.PureLin()])\n",
        "net.trainf = nl.train.train_rprop"
      ],
      "outputs": [],
      "execution_count": 52,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "error = net.train(inp, tar, epochs=1000, show=100, goal=0.00002)"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Epoch: 100; Error: 156.53503139196584;\n",
            "Epoch: 200; Error: 156.53503139196584;\n",
            "Epoch: 300; Error: 156.53503139196584;\n",
            "Epoch: 400; Error: 156.53503139196584;\n",
            "Epoch: 500; Error: 156.53503139196584;\n",
            "Epoch: 600; Error: 156.53503139196584;\n",
            "Epoch: 700; Error: 156.53503139196584;\n",
            "Epoch: 800; Error: 156.53503139196584;\n",
            "Epoch: 900; Error: 156.53503139196584;\n",
            "Epoch: 1000; Error: 156.53503139196584;\n",
            "The maximum number of train epochs is reached\n"
          ]
        }
      ],
      "execution_count": 53,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "fig=plt.figure()\n",
        "plt.plot(error)\n",
        "plt.show()"
      ],
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ],
            "image/png": [
              "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFGFJREFUeJzt3X+s3XV9x/Hnu70URDZa4MK6tlrUxokuAmmgjmVz4EpBY/kDkhIzGtakWcIyXEwczCWNKIkmiziSSSTSWY0TGf6gIUbsCm7xD4GLMAQq9gIKXZFebKkC40fb9/44n1MO7fnec297f37O85HcnPP9fD/nnM+n3+a8zufz+Z7vicxEktR/5kx3AyRJ08MAkKQ+ZQBIUp8yACSpTxkAktSnDABJ6lMGgCT1KQNAkvqUASBJfWpguhswmlNOOSWXLl063c2QpFnlgQceeD4zB3vVm9EBsHTpUoaGhqa7GZI0q0TEr8ZSzykgSepTBoAk9SkDQJL6lAEgSX3KAJCkPmUASFKfMgAkqU9VGQC/3vsKX/jh4zwx8uJ0N0WSZqwqA+C5377CjXcP86vfvDTdTZGkGavKAGjz9+4lqVmVARAx3S2QpJmvygBocwQgSc2qDICgNQTw/V+SmtUZAE4BSVJPVQZAWzoHJEmNqg4ASVKzqgPAz/+S1KzKAHANQJJ6qzIA2lwCkKRmVQZA+zRQSVKzKgPgDQ4BJKnJmAIgIn4ZET+LiIciYqiUnRQRWyJie7ldUMojIm6MiOGIeDgizu54nrWl/vaIWDs5XXINQJLGYjwjgL/IzDMzc3nZvgbYmpnLgK1lG+AiYFn5Ww/cBK3AADYA5wLnABvaoTFZXAOQpGZHMwW0GthU7m8CLuko/1q2/ASYHxELgQuBLZm5OzP3AFuAVUfx+o3aIwDf/yWp2VgDIIEfRsQDEbG+lJ2Wmc8ClNtTS/ki4JmOx+4oZU3lkqRpMDDGeudl5s6IOBXYEhE/H6Vutxn4HKX8zQ9uBcx6gLe97W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QLk9tVSr4d/ii8AngQNl+2TghczcV7Y7+3Swv2X/3lJ/tnkHMAL8W5n6+kpEvJWKj3Nm/i/wz8DTwLO0jt0D1H+sYfzHdcKOd40B0POS07NdRJwAfBv4eGb+drSqXcpmzb9FRHwE2JWZD3QWd6maY9g3mwwAZwM3ZeZZwEu8MS3Qzazvd5nCWA2cDvwh8FZaUyCHqu1Yj6apjxPW9xoDoOclp2eziDiG1pv/NzLzO6X4uYhYWPYvBHaV8tn+b3Ee8NGI+CWtX487n9aIYH5EtC9k2Nmng/0t+08Edk9lgyfIDmBHZt5btm+nFQi1HmeADwFPZeZIZr4OfAf4E+o/1jD+4zphx7vGAKj2ktMREcAtwLbM/ELHrs1A+0yAtbTWBtrlV5SzCVYAe9tDzdkgM6/NzMWZuZTWcbw7Mz8G3ANcWqod2t/2v8Olpf6s+1SYmb8GnomId5eiC4DHqPQ4F08DKyLi+PL/vN3nqo91Md7jehewMiIWlJHTylI2ftO9IDJJiywXA78AngA+Nd3tmcB+/Smtod7DwEPl72Jac59bge3l9qRSP2idEfUE8DNaZ1hMez+OsO8fBO4s998B3AcMA/8BHFvKjyvbw2X/O6a73UfR3zOBoXKsvwcsqP04A58Gfg48AnwdOLa2Yw18k9Yax+u0PsmvO5LjCvx16fswcOWRtsdvAktSn6pxCkiSNAYGgCT1KQNAkvqUASBJfcoAkKQ+ZQBIUp8yACSpTxkAktSn/h9xe1DXBMFJzQAAAABJRU5ErkJggg==\n"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 54,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "out = net.sim(inp)"
      ],
      "outputs": [],
      "execution_count": 55,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "fig=plt.figure()\n",
        "plt.plot(tar,'b.')\n",
        "plt.plot(out,'r-')\n",
        "plt.show()"
      ],
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ],
            "image/png": [
              "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFxpJREFUeJzt3X2QXNV55/HvI41GEoOE3sZIMAIJEGABLgRjGYzLVgwmQCgok+wW2Lt2bG+o2jW73o1rbSi7vDFbdhW2s3GlzMZQXm92Uw6E+CXIFCl2i6BKZQMsI5OwvEQgCyMEwoxBMm9CoxFn/zi36Z5Rj6Zn1KKnj76fqq7pe+7pe59zz+2feq6muyOlhCSpLLM6XYAkqf0Md0kqkOEuSQUy3CWpQIa7JBXIcJekAhnuklQgw12SCmS4S1KBejq142XLlqVVq1Z1aveS1JU2b978q5RS/2T9Ohbuq1atYmhoqFO7l6SuFBHPtNLPyzKSVCDDXZIKZLhLUoEMd0kqkOEuSQWaNNwj4vsR8WJEPDrB+oiIP46IrRHxSESc0/4yJUlT0cqfQv4p8B3gf06w/lJgTXV7H/An1c/D4v774RvfgIcfhr4+uPxyeOUVuPde2L4dentz++uvw969MHduXp43DxYtqre98ELu09cHp56at/3MM/Dqq7BvX31/S5fm9Q8+CHv25LbeXlixAl56Ke971izo6YHRUTj6aDjzTFi7FhYuhE2b4Ljj8jY2bYKREdi1K9cBua4TTqjvv9Y+MgJvvpm3fcopeVvDw7n2Xbvg5ZfrY1m6NI+ttxc2bIAnn8zHp7at2rGo1Qa5T238y5fnbUbk7WzfDm+8kfvPmwcf+hAsWJCP2csv5zr6++tj/OlPYceOfNyWLs1to6Owc2ceB8Bbb+Wx9Pfn9aedlvd9112wf3/e72uv5f6jo7BkCVx4YX1fP/tZrrE2j7VjsGcPzJmT97t3b15Xm4vdu/PyyEh9bC+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rAo8hegw9gaW/qC9HfYDmBHSunBavmH5LDvljm4CHg6pTScUtoH/Bh4P901BzVTPeYzbS6A/J+8wOXAx1N1rYUZPIZuC/e3v6y7+iuBq8lfzj2jREQA/w14IqX0XxpW1b5InOrnnQ3tn6j+euA84Ne1X2M7IaV0Q0ppIKW0inyM/yal9HHgPvIXoMOB9dfGdVi/IL1VKaUXgGcj4rSq6ULgcbpkDsiXY86LiKOq86lWf9fMQYOpHvN7gIsjYnH1G8zFVVvHRMQlwBeBK1JKbzSs2ghcXf210mpgDfB/mQlZ9U5e4G/Tf3RcRv7rk58DX+p0PRPU+AHyr2CPAP9Q3S4jXwO9F3iq+rmk6h/AzdWY/h8w2OkxNIxlA/W/ljmJfOJuBf4SmFu1z6uWt1brT+p03VVdZwND1Tz8FfkvL7pmDoCvAv8EPEr+Avq5M30OgNvI/0ewj/zq9TPTOebk69pbq9unZsAYtpKvodeez99t6P+lagxbgEsb2juaVb5DVZIK1G2XZSRJLTDcJalAhrskFchwl6QCGe6SVCDDXZIKZLhLUoEMd0kq0P8HBRn95XDNSmsAAAAASUVORK5CYII=\n"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 56,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "print('Prediction result: ', net.sim([inp[0]]))"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Prediction result:  [[ 0.53146853]]\n"
          ]
        }
      ],
      "execution_count": 62,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    }
  ],
  "metadata": {
    "kernel_info": {
      "name": "python3"
    },
    "language_info": {
      "mimetype": "text/x-python",
      "name": "python",
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "nbconvert_exporter": "python",
      "version": "3.5.5",
      "pygments_lexer": "ipython3"
    },
    "kernelspec": {
      "name": "python3",
      "language": "python",
      "display_name": "Python 3"
    },
    "nteract": {
      "version": "0.12.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}